-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
500 plugin infrastructure #502
base: devel
Are you sure you want to change the base?
Conversation
"dexbot" logger should use same verbosity settings defined for per_worker logger and also it should log into file 'dexbot.log' too.
Plugins are python classes supposed to serve as workers to perform any additional operations which are not performed from strategies. Example use-cases: * Download trading history * Analyze trading history * Check for updates * Report dexbot statistic Current implementation uses separate thread and asyncio event loop inside. This is a temporary solution before refactoring WorkerInfrastructure to asyncio. Closes: Codaone#500
db80b49
to
43092dc
Compare
@@ -173,6 +174,8 @@ def add_worker(self, worker_name, config): | |||
self.update_notify() | |||
|
|||
def run(self): | |||
self.plugins_thread = PluginInfrastructure(self.config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize self.plugins_thread in __init__
|
||
log = logging.getLogger(__name__) | ||
|
||
class PluginInfrastructure(threading.Thread): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add one extra line above, PEP8 error.
import dexbot.plugins | ||
from dexbot.helper import iter_namespace | ||
|
||
from bitshares import BitShares |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works but to be more specific change to from bitshares.bitshares import BitShares
.
logging.getLogger("dexbot").addHandler(ch) | ||
logging.getLogger("dexbot").addHandler(fh) | ||
logging.getLogger("dexbot").setLevel(getattr(logging, verbosity.upper())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve conflict in ui.py
Closes #500